---
description: Ensure that classes use allowed life cycle method in its body.
options: null
optionsDescription: Not configurable.
rationale: >-
  Some life cycle methods can only be used in certain class types.For example, ngOnInit() hook method should not be used in an @Injectable
  class.
ruleName: contextual-lifecycle
type: functionality
typescriptOnly: true
layout: rule
title: 'Rule: contextual-lifecycle'
optionsJSON: 'null'
---